#pragma once
#include <Arduino.h>
#include <TinyGPSPlus.h>

#define BDS_BANDRATE 115200
#define U2_TX_PIN 13
#define U2_RX_PIN 14
struct FixedPoint
{
    double latitude;
    double longitude;
    String time_str;
};

class BDS
{
public:
    enum _BaudRate {
        BaudRate_1200 = 1200,  //波特率-写入用
        BaudRate_2400 = 2400,
        BaudRate_4800 = 4800,
        BaudRate_9600 = 9600,
        BaudRate_19200 = 19200,
        BaudRate_38400 = 38400,
        BaudRate_57600 = 57600,
        BaudRate_115200 = 115200
    };
private:
    FixedPoint fixed_point;
    TinyGPSPlus gps;
public:
    void init_BDS(BDS::_BaudRate baudRate = (BDS::_BaudRate) BDS_BANDRATE, int tx_pin = U2_TX_PIN, int rx_pin = U2_RX_PIN);
    bool check_Data(void);
    FixedPoint GetFixedPoint(void){return fixed_point;};
};


